package July;

public class MathUsing {
    public static void main(String[] args) {
        //水仙花数(自幂数),pow是求3次方
        for (int i =100; i < 999; i++) {
            int ge=i%10;
            int shi=i/10%10;
            int bai=i/100%10;

            //判断每一位的三次方和是否等于本身
            int sum= (int) (Math.pow(ge,3)+Math.pow(shi,3)+Math.pow(bai,3));
            if (sum==i){
                System.out.println(sum+"是水仙花数");
            }
        }


    }
}
